﻿<UserControl x:Class="SL5.SampleApp.MainPage"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
			 xmlns:s="clr-namespace:System;assembly=mscorlib"
	xmlns:mx="clr-namespace:System.Windows.Markup;assembly=SL5.System" xmlns:SampleApp="clr-namespace:SL5.SampleApp"
			 d:DesignHeight="300" d:DesignWidth="400">
	<UserControl.Resources>
		<ObjectDataProvider x:Key="Converter" ObjectType="{mx:Type TypeName=SampleApp:MultiBooleanConverter}" MethodName="GetInstance">
			<ObjectDataProvider.MethodParameters>
				<mx:Static Member="s:Int32.MaxValue" />
			</ObjectDataProvider.MethodParameters>
		</ObjectDataProvider>
	</UserControl.Resources>
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition />
		</Grid.RowDefinitions>
		<CheckBox x:Name="C1" />
		<CheckBox x:Name="C2" Grid.Row="1"/>
		<CheckBox x:Name="C3" Grid.Row="2"/>
		<TextBlock Grid.Row="3">
			<TextBlock.Text>
				<MultiBinding Converter="{StaticResource Converter}" StringFormat="All Checked:{0}">
					<Binding Path="IsChecked" ElementName="C1" />
					<Binding Path="IsChecked" ElementName="C2" />
					<Binding Path="IsChecked" ElementName="C3" />
				</MultiBinding>
			</TextBlock.Text>
		</TextBlock>
		<TextBlock Grid.Row="4">
			<TextBlock.Text>
				<MultiBinding Converter="{mx:Static Member=SampleApp:MultiBooleanConverter.Instance}" ConverterParameter="Any" StringFormat="Any Checked:{0}">
					<Binding Path="IsChecked" ElementName="C1" />
					<Binding Path="IsChecked" ElementName="C2" />
					<Binding Path="IsChecked" ElementName="C3" />
				</MultiBinding>
			</TextBlock.Text>
		</TextBlock>
		<TextBlock Grid.Row="5">
			<TextBlock.Text>
				<MultiBinding Converter="{mx:Static Member=SampleApp:MultiBooleanConverter.Instance}" ConverterParameter="None" StringFormat="None Checked:{0}">
					<Binding Path="IsChecked" ElementName="C1" />
					<Binding Path="IsChecked" ElementName="C2" />
					<Binding Path="IsChecked" ElementName="C3" />
				</MultiBinding>
			</TextBlock.Text>
		</TextBlock>
		<Border BorderBrush="LightGray" BorderThickness="1" Grid.Row="6">
			<ItemsControl>
				<ItemsControl.ItemsSource>
					<CompositeCollection>
						<CollectionContainer>
							<mx:Array ItemType="{mx:Type TypeName=s:Int32}">
								<s:Int32>1</s:Int32>
								<s:Int32>2</s:Int32>
								<s:Int32>3</s:Int32>
							</mx:Array>
						</CollectionContainer>
						<CollectionContainer>
							<mx:Array ItemType="{mx:Type TypeName=s:String}">
								<s:String>01</s:String>
								<s:String>02</s:String>
								<s:String>03</s:String>
							</mx:Array>
						</CollectionContainer>
					</CompositeCollection>
				</ItemsControl.ItemsSource>
			</ItemsControl>
		</Border>
	</Grid>
</UserControl>